package org.playground.booking.auth.enums;

public enum PlaygroundUserRoles {
    ADMIN("ADMIN"),
    SALES("SALES"),
    CUSTOMER("CUSTOMER")


    ;
    private String role;
    PlaygroundUserRoles(String role){
        this.role=role;
    }

    public String getRole() {
        return role;
    }

    public static PlaygroundUserRoles detectRole(String role){
        PlaygroundUserRoles[] roles = PlaygroundUserRoles.values();
        for(int i=0;i<roles.length;i++){
            if(roles[i].getRole().equalsIgnoreCase(role)){
                return roles[i];
            }
        }
        return null;
    }
}
